<template>
  <div class="index.vue">
    <div class="w">
      <div class="brief_content_box">
        <div class="brief_content_right">
          <div>

            <crumbs
              @handSonNav="handSonNav"
              :navList='navList'
              v-if="navList!=undefined"
            >
              <generalize
                :sonList="sonList"
                v-if="id1==activeId"
              ></generalize>
              <myset
                :sonList="sonList"
                v-if="id2==activeId"
              ></myset>
              <myshow
                :count="count"
                :sonList="sonList"
                v-if="id3==activeId"
              ></myshow>
            </crumbs>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import crumbs from "@/components/crumbs.vue";
import generalize from "./components/generalize";
import myset from "./components/myset";
import myshow from "./components/myshow";
export default {
  components: {
    crumbs,
    generalize,
    myset,
    myshow
  },
  name: "index.vue",

  data() {
    return {
      sortId: "",
      activeId: "",
      navList: [],
      sonList: [],
      id1: "",
      id2: "",
      id3: "",
      count: 0
    };
  },
  mounted() {},
  created() {
    this.$api
      .getPermissionOne({
        parentId: this.$route.query.id,
        page: 1,
        limit: 10
      })
      .then(res => {
        this.navList = res.data.data;
        this.id1 = this.navList[0][0].sortId;
        this.activeId = this.id1;
        this.id2 = this.navList[1][0].sortId;
        this.id3 = this.navList[2][0].sortId;
        this.handSonNav(this.id1);
      });
  },
  methods: {
    handSonNav(id, page, limit) {
      this.activeId = id;
      this.$api
        .getList({
          sortId: id,
          page: page == undefined ? "1" : page,
          limit: 10
        })
        .then(res => {
          this.sonList = res.data.data;
          this.sonList.forEach(item => {
            item.img = item.img.replace(/\\/g, "/");
            // this.$store.commit("handBus", false);
            this.count = res.data.count;
            // item.img = this.$store.state.baseUrl + item.img;
          });
        });
    }
    // handSonNav(id) {
    //   this.activeId = id;
    //   // page=1&limit=2
    //   this.$api
    //     .getList({
    //       sortId: id,
    //       page: 1,
    //       limit: 8
    //     })
    //     .then(res => {
    //       console.log(res.data.data, "看看");
    //       this.sonList = res.data.data;
    //       this.sonList.forEach(item => {
    //         item.img = item.img.replace(/\\/g, "/");
    //         // item.img = this.$store.state.baseUrl + item.img;
    //       });
    //     });
    // }
  }
};
</script>

<style lang='scss' scoped>
.brief_content_box {
  // display: flex;
  margin-top: 10px;
  .brief_content_left {
    width: 261px;
    background: rgba(255, 255, 255, 1);
    .brief_left_serve {
      margin-top: 20px;
      .serve_box {
        border: 1px solid rgba(204, 204, 204, 1);
        border-top: 0;
        padding: 40px 29px 0 29px;
        .the_phone {
          display: flex;
          align-items: center;
          margin-top: 38px;
          margin-bottom: 40px;
          .the_phone_off {
            width: 53px;
            height: 1px;
            // border: 1px solid rgba(204, 204, 204, 1);
            background-color: rgba(204, 204, 204, 1);
          }
          .the_phone_title {
            font-size: 14px;
            font-weight: 400;
            margin-right: 10px;
            margin-left: 10px;
            color: rgba(128, 128, 128, 1);
          }
        }
        .serve_phone_box {
          display: flex;
          align-items: center;
          .phone_num_box {
            margin-left: 21px;
            .phone_num {
              color: #808080;
              font-size: 18px;
            }
          }

          .serve_phone {
            width: 51px;
            height: 51px;
            background: rgba(255, 255, 255, 1);
            border: 2px solid rgba(18, 150, 219, 1);
            border-radius: 50%;
            position: relative;
            .phone_img {
              width: 25px;
              height: 25px;
              position: absolute;
              top: 50%;
              left: 50%;
              margin-top: -12.5px;
              margin-left: -12.5px;
            }
          }
        }
      }
    }
    .brief_left_content {
      // height: 162px;
      border: 1px solid rgba(204, 204, 204, 1);
      border-top: 0;
      width: 100%;
      padding-right: 13px;
      padding-left: 13px;
      .content_list {
        margin-bottom: 20px;
        .content_item {
          width: 100%;
          padding-top: 15px;
          padding-bottom: 15px;
          border-bottom: 1px solid #eeeeee;
          text-align: center;
          color: #333333;
          font-size: 16px;
        }
      }
    }
  }
}
</style>
